<?php
namespace App\Services\Fund;
use App\Services\Fund\FundBorrowLog\FundBorrowLogLogic;
/**
 * 资金借款日志
 * Class FundBorrowLog
 * @package App\Services\Fund
 */
class FundBorrowLog
{
    // 获取所资金借款日志(分页)
    public function list($data): array
    {
        $data = init_array($data,['page'=>'1', 'list_rows'=>'']);
        if (empty($data)) {
            return null_data($data,"参数不能为空！");
        }
        return (new FundBorrowLogLogic())->list($data);
    }
    // 获取某些user_ids的的资金借款日志(分页)
    public function listByUserIds($data): array
    {
        $data = init_array($data,['page'=>'1', 'list_rows'=>'', 'user_ids'=>' ']);
        if (empty($data)) {
            return null_data($data,"参数不能为空！");
        }
        ValidateFundBorrowLog::checkValidate($data, ['user_ids']);
        return (new FundBorrowLogLogic())->listByUserIds($data);
    }
    // 获取某个用户某个状态的资金借款日志分页数据
    public function listByUserType($data): array
    {
         $data = init_array($data,['user_id'=>'0', 'refund_status'=>' ', 'page'=>'1', 'list_rows'=>'']);
        if (empty($data)) {
            return null_data($data,"参数不能为空！");
        }
        ValidateFundBorrowLog::checkValidate($data, ['user_ids','refund_status']);
        return (new FundBorrowLogLogic())->listByUserType($data);
    }

}